Repository navigation
Conversation
Widens test coverage of kOS so each step of the Laravel upgrade can be
checked against current behaviour: permissions on admin pages and
actions, membership status changes and the nightly status job, the
gatekeeper device API, the token API, the membership application,
training requests, scheduled jobs, a page smoke test, schema and audit
log checks. The suite grows from 98 to 266 tests.
Also fixes small bugs the tests exposed: API outbox routes shadowed by
/form_submissions/{id}, server errors when recording or deleting status
changes with bad input, the nightly status job crashing on a member with
no status history, inactive-in-memoriam not setting the withdrawal date,
blank team admin pages for members without access, and an undefined
variable in UserStatusFactory.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
ubuntu:lateslt installs PHP 8.5 as of August 2026 which the locked packages do not support. Fixes kwartzlab#137
Accessing Faker properties was deprecated in Faker 1.14.
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
Shift turned docblock types into real PHP types. Where the docblocks were wrong, pages and commands crashed instead of behaving as they did on Laravel 9: - User::roles() returns HasMany or BelongsToMany depending on its argument; declare both. - Remove return types from 17 controller, mailable and console methods that can end without returning (old behaviour: blank page / no-op). - Remove the int type from 32 controller $id parameters filled from the URL, so non-numeric segments such as /users/index no longer give a 500. - HttpsProtocolTest: the stand-in next middleware now returns a response, as real middleware does. - composer.lock for Laravel 10.50.4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- composer.lock: phpunit 10.5.67, collision 7.12. - phpunit.xml migrated with `phpunit --migrate-configuration`. - Rename the private status() test helpers in ApiTest and StatusChangesTest to addStatus(); PHPUnit 10 has a final TestCase::status(). - UpdateStatusTest: accept the provider's $shouldSend argument (PHPUnit 10 deprecation, an error in PHPUnit 11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
- Restore kOS's original storage disks. Laravel 12 moved the default
local disk to storage/app/private and adds a /storage/{path} route for
it, which overlapped the public photo URLs.
- Remove the int return type Shift re-added on three console commands
that can end without returning.
- Drop the new "composer run dev" and "setup" scripts and the
concurrently package: they assume Vite and a queue worker, which kOS
does not use.
- composer.lock: Laravel 12.73.0, owen-it/laravel-auditing 14.
Full suite: 266 tests green on Laravel 12.73.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- composer.lock: PHPUnit 12.5.44. - phpunit.xml migrated with --migrate-configuration (schema 12.5). - PermissionsTest: the "ordinary member is refused" test now accepts all three values from its shared data provider. PHPUnit 12 warns when a provider passes more arguments than a test takes. Full suite: 266 tests green, no PHPUnit deprecations or warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A small red label on the login page so testers can tell which server (and which Laravel) they are on during the upgrade. Remove it once the Laravel 13 upgrade is finished. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In an effort to make upgrading the constantly changing config files easier, Shift defaulted them and merged your true customizations - where ENV variables may not be used.
- Photos: call Intervention Image v2 directly (ImageManagerStatic).
Laravel 13 binds its own image service to the "image" container key,
which the old Image facade resolved to, so every photo upload failed.
The now-unused Image alias and Intervention service provider are removed.
- Remove beyondcode/laravel-dump-server: it does not support Laravel 13
and nothing in kOS uses it.
- Keep the old session cookie name and cache prefix defaults, which
Laravel 13 changed (members stay logged in across the upgrade).
- Restore like-for-like where Shift added new defaults: no "serve" on the
local disk (it re-adds the /storage/{path} route), no JSON error
rendering for api/* requests, and no "composer run dev"/"setup" scripts
or their npm packages.
- composer.lock: Laravel 13.43.0, Tinker 3.
Shift's rename of the CSRF middleware to PreventRequestForgery keeps the
/keys exemption; the device CSRF test passes and a real POST /keys
without a token returns 200.
Full suite: 266 tests green on Laravel 13.43.0 / PHPUnit 12.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the temporary red version label on the login page. Outside production, the login page shows a collapsible panel with the operating system, PHP, web server, database, Laravel, environment, debug flag, git branch and commit, and key package versions. Production never shows it. Superusers can see the same details at /devinfo in every environment. The page checks is_superuser() directly, so no role permission can open it. Every probe is wrapped, so a failure shows "unavailable" and the login page keeps working when the database is down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Laravel 13 needs PHP 8.3. The lint job installed PHP 8.1, and the test job used whatever PHP and global phpunit the runner happened to have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since Laravel 11 (native column renames, no Doctrine DBAL) a column added in the same Schema::table call as a rename is created first, so "after submit_options" failed on MySQL: Unknown column 'submit_options'. Laravel 9 ran the rename first. Doing the rename and the add in two steps gives the same table as before. Existing databases already ran this migration and are not affected; the tests use SQLite, which ignores column positions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fresh install differed from production (and from every copy of it) in ways that already existed on Laravel 9: - audits: auditable_id was a bigint placed after auditable_type, with the index in that order. Production's table was made by the morphs() of 2018: an unsigned integer id first, then the type, indexed (id, type). - users first_name, last_name, address, city, province, postal, gatekeepers.type, form_submissions submitter_ip and submitter_agent were nullable; production has them required. The original migrations now build production's tables. Production and other existing databases already ran them and do not change. The required columns are added nullable and then changed, because SQLite cannot add a required column without a default. Two tests stored rows production would refuse: the API test's form submissions now carry the IP and browser the app always records, and the "edit a member" action sends the address fields the edit form always sends. Checked: a fresh migrate on MySQL 8.0 and 8.4 gives table definitions identical to production's; migrate:reset and migrate again work; 272 tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The address, city, province and postal columns are NOT NULL, and blank form fields arrive as null, so clearing one on the member edit page gave a server error on MySQL. The edit now refuses a blank field with a message, as the member's own profile page already did, and the form marks them as required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the db:seed guard (kwartzlab#140), the Ubuntu 24.04 pin (kwartzlab#138), the CODEOWNERS update and the membership coordinator name (kwartzlab#145).
The Docker image is now built on ubuntu:26.04, whose default php package is PHP 8.5, and CI runs the tests and lint on PHP 8.5 to match. The 24.04 pin kept PHP 8.3 only while the Laravel 9 to 13 steps needed it. Tested on a VM running Ubuntu 26.04 with PHP 8.5 and MySQL 8.4.13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background, decisions and the review guide: kOS — Laravel 9 → 13 Upgrade
What and why
kOS moves from Laravel 9 to Laravel 13.43, PHPUnit 12, and PHP 8.5 (Ubuntu 26.04). Laravel 9 has been out of support since 2024, and every planned feature depends on a current framework. The upgrade was done one version at a time with Laravel Shift, like-for-like: no behaviour change and no new features in the upgrade steps.
This is well over the ~500-line guideline. Most of the diff is
composer.lockand Shift's generated changes. Review it one step at a time with the table below.password_resetstopassword_reset_tokens. Pending tokens are kept, anddeploy.shruns the migration.How to review: one step at a time
The branches stack, so each step has its own small diff:
main...upgrade-safety-testsupgrade-safety-tests...shift-10shift-10...shift-11shift-11...shift-12shift-12...bc002bdbc002bd...shift-13In each step, Shift's own commits come first and the hand fixes come last, in a commit named "Finish the Laravel N upgrade".
Commits after the upgrade (not like-for-like):
ubuntu:26.04, and CI runs on PHP 8.5./devinfofor superusers only. Tests are included. It replaces a temporary version badge that was added during the upgrade.migratenow builds production's schema and works on MySQL; an admin editing a member must fill in the address fields (a blank field gave a server error on MySQL).Worth knowing as a developer
Kernel.phpfiles and several providers are gone. Middleware, CSRF exceptions and routing are inbootstrap/app.php, providers are inbootstrap/providers.php, and the schedule is inroutes/console.php.diffIn*()now returns a signed float. Passtruefor an absolute value, or handle negatives in any new call.How I tested it
POST /keysfrom a device, sent without a CSRF token, still returns 200.Checklist
The 500-line guideline is set aside for this bundle because 99% of it was generated by the automated Shift service, with Cam manually checking after each step. There is no decision record: the team already knows the Laravel Shift upgrade plan well. It touches authentication, CSRF and middleware, so it needs two reviewers.
This PR supersedes #143: its safety tests are the first step here.
Rollout notes
composer install, thenphp artisan migrate, which renamespassword_resets.down()that renames the table back.Not in this PR
Bugs that testing found but that are older than the upgrade (they also happen on Laravel 9), and the proposed improvements. Both are listed in the upgrade doc.
AI use: the review, fixes, tests and docs were done with Claude Code.
🤖 Generated with Claude Code